<include file="public/head"/>
<script type="text/javascript" src="__STATIC__/js/jquery.js"></script>
<script type="text/html" id="photos-item-tpl">
    <li id="saved-image{id}">
        <input id="photo-{id}" type="hidden" name="img_url[]" value="{filepath}">
        <input class="form-control" id="photo-{id}-name" type="text" name="img_name[]" value="{name}"
               style="width: 200px;" title="图片名称">
        <img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"
             onclick="imagePreviewDialog(this.src);">
        <a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>
        <a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>
    </li>
</script>
<include file="public/scripts"/>

<style type="text/css">
    .pic-list li {
        margin-bottom: 5px;
    }
</style>
<body>
<div class="wrap js-check-wrap">
    <!--<ul class="nav nav-tabs">-->
        <!--<li><a href="{:cmf_plugin_url('QbtWxOs://AdminIndex/index')}">微信公众号信息</a></li>-->
        <!--<li class="active"><a href="{:cmf_plugin_url('QbtWxOs://AdminIndex/reply')}">公众号管理</a></li>-->
    <!--</ul>-->
    <!--<br>-->
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:cmf_plugin_url('QbtWxOs://AdminIndex/reply')}">回复消息</a></li>
        <li><a href="{:cmf_plugin_url('QbtWxOs://AdminIndex/menu')}?id=0">自定义菜单</a></li>
        <li><a href="{:cmf_plugin_url('QbtWxOs://AdminIndex/menu_list')}">个性义菜单</a></li>
    </ul>
    <br>

    <ul class="nav nav-tabs">
        <li ><a href="{:cmf_plugin_url('QbtWxOs://AdminIndex/reply')}">关注欢迎语</a></li>
        <li ><a href="{:cmf_plugin_url('QbtWxOs://AdminIndex/keyword_reply')}">关键词回复</a></li>
        <li class="active"><a href="">编辑关键词</a></li>
    </ul>
    <form action="{:cmf_plugin_url('QbtWxOs://AdminIndex/edit_keyword_action')}" method="post" class=" form-horizontal  js-ajax-form margin-top-20">
        <div class="row">
            <div class="col-md-9">
                <table class="table table-bordered">
                    <tr>
                        <th  width="150">关键词：</th>
                        <td><input type="text" class="form-control" name="keyword" value="{$info.keyword}" width="200"></td>
                        <input type="hidden" name="id" value="{$info.id}">
                    </tr>
                    <tr>
                        <th>所属类型：</th>
                        <td>

                            <input type="radio" name="type" <if condition="$info.type eq 1">checked="checked"</if> value="1" >文字 &nbsp;
                            <input type="radio" name="type" <if condition="$info.type eq 2">checked="checked"</if> value="2" >图片 &nbsp;
                            <input type="radio" name="type" <if condition="$info.type eq 3">checked="checked"</if> value="3" >图文
                        </td>
                    </tr>
                    <script>
                        $("input").click(function () {
                            var val = $('input:radio[name="type"]:checked').val();
                            if(val == 1){
                                $('.wz').show();
                                $('.tp').hide();
                                $('.tw').hide();
                            }else if(val == 2){
                                $('.wz').hide();
                                $('.tp').show();
                                $('.tw').hide();
                            }else if(val == 3){
                                $('.wz').hide();
                                $('.tp').hide();
                                $('.tw').show();
                            }
                        })
                    </script>
                    <tr class="wz" <if condition="$info.type neq 1">style="display: none" </if>>
                        <th>文字：</th>
                    <td><input type="text" class="form-control" name="str" <if condition="$info.type eq 1"> value="{$info.str}" </if> width="200"></td>
                    </tr>

                    <tr class="tp"  <if condition="$info.type neq 2">style="display: none" </if>>
                        <th>图片：</th>
                        <td>

                            <input id="photo-1" type="hidden" name="img_url" <if condition="$info.type eq 2">value="{$info.img.img_url}" </if>>
                            <input id="photo-1-name" type="text" name="img_name" title="图片名称" <if condition="$info.type eq 2">value="{$info.img.img_name}" </if> >
                            <a href="javascript:uploadOneImage('图片上传','#photo-1');">上传</a><span style="color: #42454A">(建议尺寸：750*350像素)</span>
                            <br>
                            <img id="photo-1-preview" width="150px" <if condition="$info.type eq 2">src="{:cmf_get_image_url($info.img.img_url)}" </if> >
                        </td>
                    </tr>
                    <tr class="tw" <if condition="$info.type neq 3">style="display: none" </if>><th>标题：</th>
                        <td><input type="text" class="form-control" name="title" <if condition="$info.type eq 3"> value="{$info.img_str.title}" </if> width="200"></td>
                    </tr>
                    <tr class="tw" <if condition="$info.type neq 3">style="display: none" </if>><th>描述：</th>
                    <td><input type="text" class="form-control" name="desc" <if condition="$info.type eq 3"> value="{$info.img_str.desc}" </if> width="200"></td>
                    </tr>
                    <tr class="tw" <if condition="$info.type neq 3">style="display: none" </if>><th>url跳转：</th>
                    <td><input type="text" class="form-control" name="url" <if condition="$info.type eq 3"> value="{$info.img_str.url}" </if> width="200"></td>
                    </tr>
                    <tr class="tw"  <if condition="$info.type neq 3">style="display: none" </if>>
                    <th>图片：</th>
                    <td>

                        <input id="photo-2" type="hidden" name="img_url1" <if condition="$info.type eq 3">value="{$info.img_str.img_url1}" </if>>
                        <input id="photo-2-name" type="text" name="img_name1" title="图片名称" <if condition="$info.type eq 3">value="{$info.img_str.img_name1}" </if> >
                        <a href="javascript:uploadOneImage('图片上传','#photo-2');">上传</a><span style="color: #42454A">(建议尺寸：750*350像素)</span>
                        <br>
                        <img id="photo-2-preview" width="150px" <if condition="$info.type eq 3">src="{:cmf_get_image_url($info.img_str.img_url1)}" </if> >
                    </td>
                    </tr>

                </table>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-primary js-ajax-submit">保存</button>
                        <a class="btn btn-default" href="javascript:history.back(-1)">{:lang('BACK')}</a>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>

<script type="text/javascript" src="__STATIC__/js/admin.js"></script>

<script type="text/javascript" src="__STATIC__/js/layer/layer.js"></script>
</body>
</html>
